<%@ page import="java.util.Map" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
  <head>
    <title>网站主页</title>
  </head>
  <body>
  <%
    if (session.getAttribute("userInfo") == null)  {
      out.print("<a href='/JavaWeb/LoginJump'>登录</a>&nbsp&nbsp<a href='/JavaWeb/RegistJump'>注册</a>");
    }
    else {
      String id = (String)((Map)session.getAttribute("userInfo")).get("id");
      String username = (String)((Map)session.getAttribute("userInfo")).get("username");
      out.print("欢迎您!"+ id + " " + username +"<br/><a href='/'>注销</a>");
    }

  %>
  <br>
  <h1>欢迎来到主页！！！</h1>

  </body>
</html>
